<template>
  <!-- 帮助文档 -->
  <div class="content" :class="enterpriseType === '1'? 'content01' : ''">
    <iframe :src="src" type="application/x-google-chrome-pdf" frameborder="0" :style="conheight" />
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  data() {
    return {
      currentPage: 0, // pdf文件页码
      pageCount: 0, // pdf文件总页数
      fileType: 'pdf', // 文件类型
      // pdf文件地址
      src: '/file/1.pdf',
      // iframe 的宽度和高度
      conheight: {
        width: '',
        height: ''
      }
    }
  },
  computed: {
    ...mapState({
      enterpriseType: state => state.user.enterpriseType
    })
  },
  created() {
    this.getHeight()
  },
  methods: {
    // 设置iframe 的宽度和高度
    getHeight() {
      this.conheight.width = 100 + '%'
      this.conheight.height = window.innerHeight + 'px'
    }
  }
}
</script>
<style scoped lang="scss">
  .content{
    height: calc(100vh - 130px);
    overflow-y: hidden;
    &.content01{
      height: calc(100vh - 80px);
    }
    iframe{
      height: 100%!important;
    }
  }
</style>
